<template>
  <div>
    <el-button type="danger" @click="login">登录</el-button>
    <div>code：{{ code }}</div>
    <div>name：{{ name }}</div>
    <el-button type="danger" @click="setUserInfo">更新</el-button>
  </div>
</template>

<script lang="ts" setup>
import { ref, reactive } from "vue";
import { storeToRefs } from "pinia";
import { useUserStore } from "@/stores/user";
const countStore = useUserStore();
const { code, name } = storeToRefs(countStore);

const login = () => {
  console.log("login");
};
const setUserInfo = ()=>{
  countStore.setUserInfo('123456','user')
}
</script>
